using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;

namespace TenantManagementService
{
    [DependsOn(
        typeof(TenantManagementServiceDomainModule),
        typeof(AbpEntityFrameworkCoreModule)
    )]
    public class TenantManagementServiceEntityFrameworkCoreModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAbpDbContext<TenantManagementDbContext>(options =>
            {
                options.AddDefaultRepositories(includeAllEntities: true);
            });

            Configure<AbpDbContextOptions>(options =>
            {
                options.PreConfigure<TenantManagementDbContext>(dbContextOptions =>
                {
                    // 数据库预配置
                });
            });
        }
    }
}